package com.spa.application.command.admin;

import com.spa.application.command.common.rule.RuleAddCommand;
import com.spa.infrastructure.util.UrlUtil;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
public class ShopEditCommand {

    @NotBlank(message = "门店ID不能为空")
    private String id;

    private String name;

    private String owner;

    private String phone;

    private String address;

    private String logo;

    private String businessLicense;

    private String remark;

    private Long cityId;

    private Integer withdrawPeriod;

    @NotNull(message = "规则必填")
    private List<RuleAddCommand> ruleDtoList;

    public void setLogo(String logo) {
        this.logo = UrlUtil.handleUrl(logo,",");
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = UrlUtil.handleUrl(businessLicense,",");
    }
}
